<template>
     <div class="movie hoting">
        <div class="com list">
            <ul>
                <li v-for="ele in hotingList">
                    <router-link :to="{name:'detail',params:{'id':ele.id}}">
                        <div><img :src="ele.cover.origin" alt=""></div>
                        <div class="desc clear">
                            <div class="txt fl">
                                <p class="title">{{ele.name}}</p>
                                <p class="counting"><span class="count">{{ele.cinemaCount}}</span>家影院上映<span class="num">{{ele.watchCount}}</span>人购票 </p>
                            </div>
                            <div class="fen fr">{{ele.grade}}</div>
                        </div>						
                    </router-link>
                </li>
            </ul>
        </div>	
        <div class="more">
            <router-link :to="{name:'now'}" class="text">更多热映电影</router-link>
        </div>
    </div>
</template>

<script>
    import $ from 'jquery';
    export default{
       data:function(){
            return{
                hotingList:[]
            }
        },
        mounted:function(){
            var self=this;
            var now=new Date().getTime();
            // ajax请求得到正在热映信息
            $.get('http://localhost:3000/hoting?time='+now,function(res){
                self.hotingList=res.data.films;
            })	 	
        }
    }
</script>